package com.springmvc.utils.mj;

import java.util.ArrayList;
import java.util.Deque;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class MJRoom {

	// 牌桌上剩余麻将
	private Deque<String>			  pondmj;

	// 当前出的牌
	private String					  playmj;

	private String					  houkou;

	// 出牌人
	private String					  playuserno;

	// 出牌人下一个人的id
	private String					  nextplayuserno;

	// 1胡 2杠对 3吃（前端判断计时状态）
	private String					  playtype;

	//中间牌桌上的牌
	private List<String>			  centermj	  = new ArrayList<String>();

	// 准备用户 key 1 2 3 4 value 用户id
	private Map<String, String>		  readyuserno = new HashMap<String, String>();

	// 手中麻将
	private Map<String, List<String>> usermj	  = new HashMap<String, List<String>>();

	// 明牌麻将 key 1 2 3 4
	private Map<String, List<String>> usermmj	  = new HashMap<String, List<String>>();

	public Deque<String> getPondmj() {
		return pondmj;
	}

	public void setPondmj(Deque<String> pondmj) {
		this.pondmj = pondmj;
	}

	public String getPlaymj() {
		return playmj;
	}

	public void setPlaymj(String playmj) {
		this.playmj = playmj;
	}

	public String getPlayuserno() {
		return playuserno;
	}

	public void setPlayuserno(String playuserno) {
		this.playuserno = playuserno;
	}

	public String getNextplayuserno() {
		return nextplayuserno;
	}

	public void setNextplayuserno(String nextplayuserno) {
		this.nextplayuserno = nextplayuserno;
	}

	public Map<String, String> getReadyuserno() {
		return readyuserno;
	}

	public void setReadyuserno(Map<String, String> readyuserno) {
		this.readyuserno = readyuserno;
	}

	public Map<String, List<String>> getUsermj() {
		return usermj;
	}

	public void setUsermj(Map<String, List<String>> usermj) {
		this.usermj = usermj;
	}

	public Map<String, List<String>> getUsermmj() {
		return usermmj;
	}

	public void setUsermmj(Map<String, List<String>> usermmj) {
		this.usermmj = usermmj;
	}

	public String getHoukou() {
		houkou = getPondmj().getLast();
		return houkou;
	}

	public void setHoukou(String houkou) {
		this.houkou = getPondmj().getLast();
		;
	}

	/**
	 * 抓牌，获取下一张牌
	 * 
	 * @return
	 */
	public String nextMj() {
		String mj = getPondmj().removeFirst();
		return mj;
	}

	/**
	 * 删除最后一张牌
	 * 
	 * @return
	 */
	public String lastMj() {
		String mj = getPondmj().removeLast();
		return mj;
	}

	public List<String> getCentermj() {
		return centermj;
	}

	public void setCentermj(List<String> centermj) {
		this.centermj = centermj;
	}

	public String getPlaytype() {
		return playtype;
	}

	public void setPlaytype(String playtype) {
		this.playtype = playtype;
	}

}
